Method, device and computer program product for data writing

ABSTRACT

Techniques for data writing involve: determining an unavailable storage zone in multiple storage zones of a storage area, wherein each storage zone is used to store a zip header and compressed data corresponding to the zip header; acquiring a reference zip header for the unavailable storage zone, wherein the reference zip header includes metadata indicating a zone length of the unavailable storage zone; and generating consecutive write requests for the storage area based at least on target data to be written to the storage area and the reference zip header, so as to write the target data to available storage zones in the multiple storage zones. Accordingly, rewriting of data can be implemented by constructing large consecutive write requests, thus improving the write performance of the storage device.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to Chinese Patent Application No.CN202110013351.6, on file at the China National Intellectual PropertyAdministration (CNIPA), having a filing date of Jan. 6, 2021 and having“METHOD, DEVICE AND COMPUTER PROGRAM PRODUCT FOR DATA WRITING” as atitle, the contents and teachings of which are herein incorporated byreference in their entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of computers,and in particular to a method, a device, and a computer program productfor data writing.

BACKGROUND

In order to reduce the storage space occupied by data in a storagedevice, the data can be compressed at a certain compression ratio beforeit is written to a storage area. When the storage area is written withdata (e.g., input/output (I/O) instructions) compressed at a certaincompression ratio for a first time, the data is consecutive within thestorage area. Subsequent data can be rewritten to the same storage areato overwrite the original data.

A physical storage area can be divided into several zones of a page sizeaccording to a paging management solution, wherein the page size is theminimum allocation unit of 4 KB or 8 KB. If the subsequent data has ahigher compression ratio than the original data, the subsequent data isusually non-consecutive within the same storage area and there is a gap(also called a “void”) between the subsequent data and the originaldata. In addition, some original data may also be recycled and marked asunavailable and become gaps that affect data writing.

SUMMARY OF THE INVENTION

The embodiments of the present disclosure provide a solution for datawriting.

According to a first aspect of the present disclosure, a method for datawriting is proposed. The method includes: determining an unavailablestorage zone in multiple storage zones of a storage area, wherein eachstorage zone is used to store a zip header and compressed datacorresponding to the zip header; acquiring a reference zip header forthe unavailable storage zone, wherein the reference zip header includesmetadata indicating a zone length of the unavailable storage zone; andgenerating consecutive write requests for the storage area based atleast on target data to be written to the storage area and the referencezip header, so as to write the target data to available storage zones inthe multiple storage zones.

According to a second aspect of the present disclosure, an electronicdevice is proposed. The device includes: at least one processing unit;and at least one memory which is coupled to the at least one processingunit and stores instructions for execution by the at least oneprocessing unit, wherein the instructions, when executed by the at leastone processing unit, cause the device to perform actions including:determining an unavailable storage zone in multiple storage zones of astorage area, wherein each storage zone is used to store a zip headerand compressed data corresponding to the zip header; acquiring areference zip header for the unavailable storage zone, wherein thereference zip header includes metadata indicating a zone length of theunavailable storage zone; and generating consecutive write requests forthe storage area based at least on target data to be written to thestorage area and the reference zip header, so as to write the targetdata to available storage zones in the multiple storage zones.

In a third aspect of the present disclosure, a computer program productis provided. The computer program product is stored in a non-transitorycomputer storage medium and includes machine-executable instructionsthat, when run in a device, cause the device to perform any step of themethod described according to the first aspect of the presentdisclosure.

The Summary of the Invention section is provided in order to introducethe selection of concepts in a simplified form, which will be furtherdescribed in the Detailed Description below. The Summary of theInvention section is not intended to identify key features or essentialfeatures of the present disclosure, nor is it intended to limit thescope of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects, features, and advantages of the presentdisclosure will become more apparent by describing the exampleembodiments of the present disclosure in more detail in combination withthe accompanying drawings. In the example embodiments of the presentdisclosure, the same reference numerals generally represent the sameparts.

FIGS. 1A-1D illustrate a schematic diagram of conventional datarewriting;

FIG. 2 illustrates a schematic diagram of mapping between backupmetadata and compressed data;

FIG. 3 illustrates a schematic diagram of an example environment wherethe embodiments of the present disclosure can be implemented;

FIG. 4 illustrates a flowchart of a process of data writing according toembodiments of the present disclosure;

FIG. 5 illustrates a schematic diagram of candidate zip headersaccording to embodiments of the present disclosure; and

FIG. 6 illustrates a schematic block diagram of an example device thatcan be used to implement embodiments of the present disclosure.

DETAILED DESCRIPTION

The individual features of the various embodiments, examples, andimplementations disclosed within this document can be combined in anydesired manner that makes technological sense. Furthermore, theindividual features are hereby combined in this manner to form allpossible combinations, permutations and variants except to the extentthat such combinations, permutations and/or variants have beenexplicitly excluded or are impractical. Support for such combinations,permutations and variants is considered to exist within this document.

It should be understood that the specialized circuitry that performs oneor more of the various operations disclosed herein may be formed by oneor more processors operating in accordance with specialized instructionspersistently stored in memory. Such components may be arranged in avariety of ways such as tightly coupled with each other (e.g., where thecomponents electronically communicate over a computer bus), distributedamong different locations (e.g., where the components electronicallycommunicate over a computer network), combinations thereof, and so on.

Preferred embodiments of the present disclosure will be described inmore detail below with reference to the accompanying drawings. Althoughthe preferred embodiments of the present disclosure are shown in theaccompanying drawings, it should be understood that the presentdisclosure can be implemented in various forms and should not be limitedby the embodiments set forth herein. Instead, these embodiments areprovided to make the present disclosure more thorough and complete, andto fully convey the scope of the present disclosure to those skilled inthe art.

The term “include” and variants thereof as used herein indicateopen-ended inclusion, i.e., “including but not limited to.” Unlessspecifically stated, the term “or” means “and/or.” The term “based on”means “based at least in part on.” The terms “an example embodiment” and“an embodiment” indicate “at least one example embodiment.” The term“another embodiment” indicates “at least one additional embodiment.” Theterms “first,” “second,” and the like, may refer to different or thesame objects. Other explicit and implicit definitions may also beincluded below.

Modern storage systems (e.g., all-flash array (AFA) storage devices)using the real-time data compression (Iterative Length Compression, ILC)technology can provide significant reduction of the use of disk space.As mentioned earlier, a storage area is divided into multiple storagezones in accordance with a page size. When data is rewritten in a sectorof the storage area where original data was previously stored, no changein metadata is caused. If the rewritten data has the same compressionratio as the original data (i.e., a ratio of an amount of data beforecompression to an amount of data after compression), the storage spaceof the storage area can be fully utilized, and the rewritten data iswritten to a backend driving device in a consecutive manner.

However, the inventors found that if the rewritten data has a highercompression ratio than that of the original data, it would cause theoriginally consecutive data to be stored in a non-consecutive manner andleave gaps between storage zones. In addition, some original data may berecycled, in which case the metadata will be modified to indicate thatthe corresponding storage zone is unavailable, and the stored originaldata will not be replaced. The conventional data rewriting process willbe described in detail below with reference to FIGS. 1A to 1D.

As shown in FIG. 1A, storage area 110 includes four storage zones 120-1,120-2, 120-3, and 120-4 (individually or collectively referred to asstorage zones 120). Each storage zone 120 stores original data ofdifferent sizes. For example, the length of storage zone 120-1 is 13sectors, the length of storage zone 120-2 is 13 sectors, the length ofstorage zone 120-3 is 6 sectors, and the length of storage zone 120-4 is16 sectors.

In FIG. 1B, the data in storage zone 120-3 is recycled, so that storagezone 120-3 is marked as unavailable. In this case, the user will not beable to access this storage zone 120-3 or to write data to this storagezone 120-3. It should be understood that, based on the ILC technology,the original data stored in this storage zone 120-3 will not be deleted,but only the corresponding metadata is modified to indicate that thisstorage zone 120-3 is unavailable.

In FIG. 1C, target data 130 (also referred to as rewritten data 130)includes three items of rewritten data that need to be written tostorage area 110 to overwrite the original data. Specifically, the firstitem of rewritten data 130-1 has a length of 7 sectors, the second itemof rewritten data 130-2 has a length of 12 sectors, and the third itemof rewritten data 130-3 has a length of 16 sectors.

In this case, the first item of rewritten data will be written tostorage zone 120-1 and result in void 140-1 having a length of 6sectors; and the second item of rewritten data will be written tostorage zone 120-2 and result in void 140-2 having a length of 1 sector.

As shown in FIG. 1C, in this case, 3 voids will be generated, namelyvoid 140-1, void 140-2, and unavailable storage zone 120-3.

According to the conventional solution, consecutive write requests canbe constructed by writing padding data. For example, as shown in FIG.1D, the write requests can be constructed according to the storagegranularity (e.g., M sectors per storage page, with M being 8, forexample) of the storage area.

For example, the first item of rewritten data 130-1 (having a length of7 sectors) can be combined with padding data 150-1 having a length of 1sector as the written data for the first 8 sectors. Data 150-3 of thefirst 3 sectors in the second item of rewritten data 130-2 can becombined with padding data 150-2 having a length of 5 sectors as thewritten data for the second 8 sectors.

However, the conventional solution cannot efficiently processunavailable storage zone 120-3. Some conventional solutions do notprocess unavailable storage zone 120-3 to avoid affecting useful data inunavailable storage zone 120-3. However, this will cause the constructedwrite requests to be non-consecutive, affecting the write performance ofthe storage system.

In addition, some conventional solutions construct consecutive writerequests by simply rewriting unavailable storage zone 120-3 by writingpadding data (for example, writing 0s). However, since unavailablestorage zone 120-3 includes zip header information, such a zip headercan help reconstruct backup metadata (e.g., a VBM file). If the zipheader in unavailable storage zone 120-3 is directly overwritten, thiswill cause the file system to be unable to reconstruct the backupmetadata.

FIG. 2 illustrates schematic diagram 200 of mapping between backupmetadata and compressed data. As shown in FIG. 2, backup metadata 210can maintain metadata corresponding to different storage zones 120, andits length is used to indicate the starting position of each zone 120,thereby constructing the mapping between the metadata and data portions220.

By way of example, corresponding to the example in FIG. 1C, backupmetadata 210 includes backup metadata 212, 214, 216, and 218corresponding to the four storage zones 120, respectively. Each item ofbackup metadata can maintain corresponding length information to bedirected to the corresponding data portion.

For example, backup metadata 212 may correspond to the first item ofrewritten data 130-1 (which includes a zip header and correspondingcompressed data) and void 140-1; backup metadata 214 may correspond tothe second item of rewritten data 130-2 and void 140-2; backup metadata216 may correspond to unavailable storage zone 120-3; and backupmetadata 218 may correspond to the third item of rewritten data 130-3.

As can be seen, if the zip header included in unavailable rewritten data120-3 is overwritten, this will cause the file system to be unable toreconstruct the backup metadata according to the zip header included indata portion 220 once backup metadata 210 becomes corrupted.

According to the embodiments of the present disclosure, a solution fordata writing is provided. This solution enables the efficientconstruction of large consecutive writing by rewriting the zip headercorresponding to the length of the unavailable storage zone. Inaddition, this solution retains useful information in the zip header,thus enabling support for reconstruction of the backup metadata.

The embodiments of the present disclosure will be specifically describedbelow with reference to the accompanying drawings. FIG. 3 illustrates aschematic diagram of example environment 300 for data writing accordingto embodiments of the present disclosure. As shown in FIG. 3, exampleenvironment 300 includes host 310, storage manager 320, and storagedevice 330. It should be understood that the structure of exampleenvironment 300 is described for illustrative purpose only and does notimply any limitation to the scope of the present disclosure. Forexample, the embodiments of the present disclosure may also be appliedto an environment different from example environment 300.

Host 310 may be, for example, any physical computer, virtual machine,server, etc., running user applications. Host 310 can send an I/Orequest to storage manager 320, for example, for reading data fromstorage device 330 and/or writing data to storage device 330. Inresponse to receiving a read request from host 310, storage manager 320can read data from storage device 330 and return the read data to host310. In response to receiving a write request from host 310, storagemanager 320 can write data to storage device 330. Storage device 330 canbe any non-volatile storage medium currently known or to be developed infuture, such as a disk, a solid state disk (SSD) or disk array (RAID),etc.

Storage manager 320 can be deployed with a compression/decompressionengine (not shown). For example, when storage manager 320 receives arequest from host 310 to write data to storage device 330, storagemanager 320 can use the compression/decompression engine to compress thedata to be stored and then store the compressed data to storage device330.

As described above, storage manager 320 is capable of constructingconsecutive write requests while storage manager 320 is performing datawriting. The detailed process of data writing according to embodimentsof the present disclosure will be described below in combination withFIGS. 4 to 5.

FIG. 4 illustrates a flowchart of example process 400 for data writingaccording to embodiments of the present disclosure. For example, process400 may be performed by storage manager 320 as shown in FIG. 3. Itshould be understood that process 400 may also be performed by any othersuitable device and may include additional actions not shown and/or mayomit the actions shown, and the scope of the present disclosure is notlimited in this regard. For ease of description, process 400 will bedescribed below with reference to FIGS. 1 to 3.

At block 402, storage manager 320 determines unavailable storage zone120-3 in multiple storage zones 120 of storage area 110, wherein eachstorage zone 120 is used to store a zip header and compressed datacorresponding to the zip header.

As shown in FIG. 1, upon receiving a rewrite request to write the targetdata to storage area 110, storage manager 320 may indicate that storagearea 110 includes unavailable storage zone 120-3.

In some implementations, storage zone 120-3 may be marked as unavailablein response to being recycled. Alternatively, storage zone 120-3 mayalso be marked as unavailable in response to receiving a rewrite requestwith a data size larger than the length of that storage zone.

In some implementations, storage manager 320 may mark storage zone 120-3as unavailable by modifying the metadata corresponding to storage zone120-3, without deleting the compressed data stored in storage zone120-3. Such an unavailable storage zone 120-3 will not be accessible,thus creating the voids (or, gaps) described above.

At block 404, storage manager 320 acquires a reference zip header forunavailable storage zone 120-3, wherein the reference zip headerincludes metadata indicating the zone length of the unavailable storagezone.

In some implementations, in order to enable storage manager 320 toconstruct consecutive write requests without affecting the zip headerincluded in unavailable storage zone 120-3, storage manager 320 canpre-construct a set of candidate zip headers.

FIG. 5 illustrates schematic diagram 500 of candidate zip headersaccording to embodiments of the present disclosure. As shown in FIG. 5,storage manager 320 can allocate a buffer of a predetermined size in amemory for storing a set of candidate zip headers 510-1, 510-2, to 510-N(individually or collectively referred to as candidate zip headers 510).

As shown in FIG. 5, each candidate zip header 510 corresponds to adifferent zone length (ZLEN). For example, candidate zip header 510-1corresponds to a zone having a zone length of 16 sectors and storesmetadata indicating that the zone length is 16 sectors. Candidate zipheader 510-2 corresponds to a zone having a zone length of 15 sectorsand stores metadata indicating that the zone length is 15 sectors.

Since the file system needs to utilize only the zone length informationin the zip header when reconstructing backup metadata, candidate zipheader 510-1 may also include other appropriate metadata forverification purposes. It should be understood that other metadata canbe initialized as any appropriate content, and the present disclosure isnot intended to be limiting in this respect.

After completing the construction of the set of candidate zip headers510, storage manager 320 can use this set of candidate zip headers 510to determine a reference zip header corresponding to unavailable storagezone 120-3.

Specifically, storage manager 320 can determine the zone length ofunavailable storage zone 120-3. Taking FIG. 1C as an example, storagemanager 320 determines that the zone length of this unavailable storagezone 120-3 is 6 sectors according to the metadata (e.g., the VBM file)in the memory, for example.

Storage manager 320 can determine an index for the reference zip headerbased on the zone length. By way of example, depending on the order inwhich the set of candidate zip headers 510 are organized, different zonelengths may correspond to different indexes. For example, in FIG. 5,candidate zip headers 510 are arranged in a descending order of the zonelength, and accordingly, the index corresponding to the zone length (6)may be determined as 10, i.e., indicating the 11th candidate zip headerin the set of candidate zip headers 510.

Additionally, storage manager 320 determines, based on the index, thereference zip header from the set of candidate zip headers 510corresponding to different zone lengths. Taking FIG. 5 as an example,storage manager 320 can determine the 11th candidate zip header as thereference zip header for unavailable storage zone 120-3.

Continuing to refer to FIG. 2, at block 406, storage manager 320generates consecutive write requests for storage area 110 based at leaston target data 130 to be written into the storage area and the referencezip header, so as to write the target data to available storage zones inthe multiple storage zones 120.

In some implementations, for unavailable storage zone 120-3, storagemanager 320 can generate zone padding data for the unavailable storagezone using the reference zip header, wherein the zone padding dataincludes the reference zip header and first padding data that is used tooverwrite compressed data previously stored in the unavailable storagezone.

Taking FIG. 1C as an example, storage manager 320 can generate zonepadding data for unavailable storage zone 120-3, wherein the firstsector may be padded using the reference zip header and the remaining 5sectors may be padded using a predetermined value (e.g., 0).

Additionally, storage manager 320 can generate consecutive writerequests based at least on target data 130 and the zone padding data.Specifically, if data in only a portion of the available storage zonesin the multiple storage zones 120 needs to be overwritten by the targetdata, storage manager 320 can determine a remaining portion of theavailable storage zones that does not need to be replaced with thetarget data.

Taking FIG. 1C as an example, storage zone 120-1 includes the remainingportion that is not overwritten, that is, void 140-1. Storage zone 120-2includes the remaining portion that is not overwritten, that is, void140-2.

Storage manager 320 can generate the second padding data for theremaining portion. By way of example, storage manager 320 can generatethe second padding data by writing a predetermined value (e.g., 0).

Additionally, storage manager 320 can generate the consecutive writerequests based on the target data, the zone padding data, and the secondpadding data. As shown in FIG. 1C, according to the solution of thepresent disclosure, storage manager 320 can determine that the first 7sectors of storage zone 120-1 will be written with first rewritten data130-1 and the next 6 sectors will be written with the padding data; thefirst 12 sectors of storage zone 120-2 will be written with secondrewritten data 130-2 and the next 1 sector will be written with thepadding data; storage zone 120-3 will be written with the padding data;and storage zone 120-4 will be written with third rewritten data 130-3.Based on this approach, storage manager 320 can generate largeconsecutive write requests.

In some implementations, in order to enable the written data to alignwith the storage granularity of storage area 110, storage manager 320can also determine multiple data portions from the target data, the zonepadding data, and the second padding data according to the storagegranularity associated with storage area 110, wherein the size of eachdata portion corresponds to the storage granularity.

Taking FIG. 1D as an example, if the storage granularity (i.e., the sizeof each storage page) of storage area 110 is 8 sectors, storage manager320 can further slice the consecutive data determined above intomultiple data portions having a size of 8 sectors. For example, firstrewritten data 130-1 and padding data 150-1 form a first data portion;padding data 150-2 and data 150-3 of the first 3 sectors of the seconditem of rewritten data 130-2 form a second data portion; data 150-4 of 8sectors in the second item of rewritten data 130-2 form a third dataportion; data 150-5 of the last 1 sector of the second item of rewrittendata 130-2, padding data 150-6, and padding data 150-7 for unavailablestorage zone 120-3 form a fourth data portion; and the third item ofrewritten data 130-3 forms a fifth data portion. Additionally, thestorage manager can generate the consecutive write requests based on themultiple data portions. Based on this approach, the write requests cancorrespond to the storage page sizes of the storage area, therebyensuring alignment of data.

In some implementations, in response to a request to reconstruct backupmetadata for storage area 110, storage manager 320 can reconstruct thebackup metadata based on the zone length of unavailable storage zone120=3, wherein the backup metadata indicates a distribution of themultiple storage zones. Specifically, in the event that backup metadata210 as shown in FIG. 2 is corrupted, storage manager 320 can reconstructthe VBM file using the zone length (e.g., 6 sectors) indicated in thereference zip header that is rewritten into unavailable storage zone150-7, wherein such a VBM file is capable of indicating the distributionof multiple storage zones 120.

Based on the methods discussed above, the embodiments of the presentdisclosure are able to construct large consecutive write requests,thereby improving the write performance of the storage system. Inaddition, by effectively retaining the zone length information for theunavailable storage zone, the embodiments of the present disclosure arealso able to support the reconstruction of backup metadata, therebyimproving the stability of the storage system.

FIG. 6 illustrates a schematic block diagram of example device 600 thatcan be used to implement the embodiments of the content of the presentdisclosure. For example, storage manager 320 according to theembodiments of the present disclosure may be implemented by device 600.As shown in the figure, device 600 includes central processing unit(CPU) 601 that may perform various appropriate actions and processingaccording to computer program instructions stored in read-only memory(ROM) 602 or computer program instructions loaded from storage unit 608into random access memory (RAM) 603. In RAM 603, various programs anddata required for the operation of the device 600 can also be stored.CPU 601, ROM 602, and RAM 603 are connected to each other through bus604. Input/output (I/O) interface 605 is also connected to bus 604.

Multiple components in device 600 are connected to I/O interface 605,including: input unit 606, such as a keyboard and a mouse; output unit607, such as various types of displays and speakers; storage unit 608,such as a magnetic disk and an optical disk; and communication unit 609,such as a network card, a modem, and a wireless communicationtransceiver. Communication unit 609 allows device 600 to exchangeinformation/data with other devices via a computer network, such as theInternet, and/or various telecommunication networks.

The various processes and processing described above, such as process400, may be executed by processing unit 601. For example, in someembodiments, process 400 may be implemented as a computer softwareprogram that is tangibly included in a machine-readable medium, forexample, storage unit 608. In some embodiments, part or all of thecomputer program may be loaded and/or installed to device 600 via ROM602 and/or communication unit 609. When the computer program is loadedinto RAM 603 and executed by CPU 601, one or more actions of process 400described above may be implemented.

The present disclosure may be a method, an apparatus, a system, and/or acomputer program product. The computer program product may include acomputer-readable storage medium on which computer-readable programinstructions for performing various aspects of the present disclosureare loaded.

The computer-readable storage medium may be a tangible device that canhold and store instructions used by an instruction execution device. Forexample, the computer-readable storage medium may be, but is not limitedto, an electric storage device, a magnetic storage device, an opticalstorage device, an electromagnetic storage device, a semiconductorstorage device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of computer-readable storagemedia include: a portable computer disk, a hard disk, a random accessmemory (RAM), a read-only memory (ROM), an erasable programmableread-only memory (EPROM or a flash memory), a static random accessmemory (SRAM), a portable compact disc read-only memory (CD-ROM), adigital versatile disc (DVD), a memory stick, a floppy disk, amechanical encoding device, for example, a punch card or a raisedstructure in a groove with instructions stored thereon, and any suitablecombination of the foregoing. The computer-readable storage medium usedherein is not to be interpreted as transient signals per se, such asradio waves or other freely propagating electromagnetic waves,electromagnetic waves propagating through waveguides or othertransmission media (e.g., light pulses through fiber-optic cables), orelectrical signals transmitted through electrical wires.

The computer-readable program instructions described herein can bedownloaded from a computer-readable storage medium to variouscomputing/processing devices, or downloaded to an external computer orexternal storage device via a network, such as the Internet, a localarea network, a wide area network, and/or a wireless network. Thenetwork may include copper transmission cables, fiber optictransmission, wireless transmission, routers, firewalls, switches,gateway computers, and/or edge servers. A network adapter card ornetwork interface in each computing/processing device receivescomputer-readable program instructions from the network and forwards thecomputer-readable program instructions for storage in acomputer-readable storage medium in each computing/processing device.

Computer program instructions for performing the operations of thepresent disclosure may be assembly instructions, instruction setarchitecture (ISA) instructions, machine instructions, machine-relatedinstructions, microcode, firmware instructions, state setting data, orsource or object code written in any combination of one or moreprogramming languages, wherein the programming languages includeobject-oriented programming languages, such as Smalltalk and C++, andconventional procedural programming languages, such as the “C” languageor similar programming languages. Computer-readable program instructionsmay be executed entirely on a user's computer, partly on a user'scomputer, as a stand-alone software package, partly on a user's computerand partly on a remote computer, or entirely on a remote computer or aserver. In the case involving a remote computer, the remote computer canbe connected to a user's computer through any kind of network, includinga local area network (LAN) or a wide area network (WAN), or it can beconnected to an external computer (for example connected through theInternet using an Internet service provider). In some embodiments, anelectronic circuit, for example, a programmable logic circuit, a fieldprogrammable gate array (FPGA), or a programmable logic array (PLA), ispersonalized by utilizing state information of the computer-readableprogram instructions, wherein the electronic circuit may executecomputer-readable program instructions so as to implement variousaspects of the present disclosure.

Various aspects of the present disclosure are described herein withreference to flowcharts and/or block diagrams of the method, theapparatus (system), and the computer program product according toembodiments of the present disclosure. It should be understood that eachblock of the flowcharts and/or block diagrams and combinations of blocksin the flowcharts and/or block diagrams can be implemented bycomputer-readable program instructions.

These computer-readable program instructions can be provided to aprocessing unit of a general-purpose computer, a special-purposecomputer, or a further programmable data processing apparatus, therebyproducing a machine, such that these instructions, when executed by theprocessing unit of the computer or the further programmable dataprocessing apparatus, produce means (e.g., specialized circuitry) forimplementing functions/actions specified in one or more blocks in theflowcharts and/or block diagrams. These computer-readable programinstructions may also be stored in a computer-readable storage medium,and these instructions cause a computer, a programmable data processingapparatus, and/or other devices to operate in a specific manner; andthus the computer-readable medium having instructions stored includes anarticle of manufacture that includes instructions that implement variousaspects of the functions/actions specified in one or more blocks in theflowcharts and/or block diagrams.

The computer-readable program instructions may also be loaded to acomputer, a further programmable data processing apparatus, or a furtherdevice, so that a series of operating steps may be performed on thecomputer, the further programmable data processing apparatus, or thefurther device to produce a computer-implemented process, such that theinstructions executed on the computer, the further programmable dataprocessing apparatus, or the further device may implement thefunctions/actions specified in one or more blocks in the flowchartsand/or block diagrams.

The flowcharts and block diagrams in the drawings illustrate thearchitectures, functions, and operations of possible implementations ofthe systems, methods, and computer program products according to variousembodiments of the present disclosure. In this regard, each block in theflowcharts or block diagrams may represent a module, a program segment,or part of an instruction, the module, program segment, or part of aninstruction including one or more executable instructions forimplementing specified logical functions. In some alternativeimplementations, functions marked in the blocks may also occur in anorder different from that marked in the accompanying drawings. Forexample, two successive blocks may actually be executed in parallelsubstantially, or they may be executed in an opposite order sometimes,depending on the functions involved. It should be further noted thateach block in the block diagrams and/or flowcharts as well as acombination of blocks in the block diagrams and/or flowcharts may beimplemented using a special hardware-based system that executesspecified functions or actions, or using a combination of specialhardware and computer instructions.

Various implementations of the present disclosure have been describedabove. The foregoing description is illustrative rather than exhaustive,and is not limited to the disclosed implementations. Numerousmodifications and alterations are apparent to persons of ordinary skillin the art without departing from the scope and spirit of theillustrated implementations. The selection of terms used herein isintended to best explain the principles and practical applications ofthe implementations or the improvements to technologies on the market,or to enable other persons of ordinary skill in the art to understandthe implementations disclosed herein.

1. A method for data writing, comprising: determining an unavailablestorage zone in multiple storage zones of a storage area, wherein eachstorage zone is used to store a zip header and compressed datacorresponding to the zip header; acquiring a reference zip header forthe unavailable storage zone, wherein the reference zip header includesmetadata indicating a zone length of the unavailable storage zone; andgenerating consecutive write requests for the storage area based atleast on target data to be written to the storage area and the referencezip header, so as to write the target data to available storage zones inthe multiple storage zones.
 2. The method according to claim 1, whereinacquiring the reference zip header includes: determining the zone lengthof the unavailable storage zone; determining an index for the referencezip header based on the zone length; and determining, based on theindex, the reference zip header from a set of candidate zip headerscorresponding to different zone lengths.
 3. The method according toclaim 1, wherein generating consecutive write requests for the storagearea includes: generating zone padding data for the unavailable storagezone using the reference zip header, wherein the zone padding dataincludes the reference zip header and first padding data that is used tooverwrite compressed data previously stored in the unavailable storagezone; and generating the consecutive write requests based at least onthe target data and the zone padding data.
 4. The method according toclaim 3, wherein generating the consecutive write requests based atleast on the target data and the zone padding data includes: if data inonly a portion of the available storage zones in the multiple storagezones needs to be overwritten by the target data, determining aremaining portion of the available storage zones that does not need tobe replaced with the target data; generating second padding data for theremaining portion; and generating the consecutive write requests basedon the target data, the zone padding data, and the second padding data.5. The method according to claim 4, wherein at least one of the firstpadding data and the second padding data is generated based on apredetermined value.
 6. The method according to claim 4, whereingenerating the consecutive write requests based on the target data, thezone padding data, and the second padding data includes: determiningmultiple data portions from the target data, the zone padding data, andthe second padding data according to a storage granularity associatedwith the storage area, wherein the size of each data portion correspondsto the storage granularity; and generating the consecutive writerequests based on the multiple data portions.
 7. The method according toclaim 1, further comprising: reconstructing, in response to a request toreconstruct backup metadata for the storage area, the backup metadatabased on the zone length of the unavailable storage zone, wherein thebackup metadata indicates a distribution of the multiple storage zones.8. The method according to claim 1, wherein the unavailable storage zoneis marked as unavailable in response to being recycled.
 9. An electronicdevice, comprising: at least one processing unit; and at least onememory which is coupled to the at least one processing unit and storesinstructions for execution by the at least one processing unit, whereinthe instructions, when executed by the at least one processing unit,cause the device to perform actions including: determining anunavailable storage zone in multiple storage zones of a storage area,wherein each storage zone is used to store a zip header and compresseddata corresponding to the zip header; acquiring a reference zip headerfor the unavailable storage zone, wherein the reference zip headerincludes metadata indicating a zone length of the unavailable storagezone; and generating consecutive write requests for the storage areabased at least on target data to be written to the storage area and thereference zip header, so as to write the target data to availablestorage zones in the multiple storage zones.
 10. The device according toclaim 9, wherein acquiring the reference zip header includes:determining the zone length of the unavailable storage zone; determiningan index for the reference zip header based on the zone length; anddetermining, based on the index, the reference zip header from a set ofcandidate zip headers corresponding to different zone lengths.
 11. Thedevice according to claim 9, wherein generating consecutive writerequests for the storage area includes: generating zone padding data forthe unavailable storage zone using the reference zip header, wherein thezone padding data includes the reference zip header and first paddingdata that is used to overwrite compressed data previously stored in theunavailable storage zone; and generating the consecutive write requestsbased at least on the target data and the zone padding data.
 12. Thedevice according to claim 11, wherein generating the consecutive writerequests based at least on the target data and the zone padding dataincludes: if data in only a portion of the available storage zones inthe multiple storage zones needs to be overwritten by the target data,determining a remaining portion of the available storage zones that doesnot need to be replaced with the target data; generating second paddingdata for the remaining portion; and generating the consecutive writerequests based on the target data, the zone padding data, and the secondpadding data.
 13. The device according to claim 12, wherein at least oneof the first padding data and the second padding data is generated basedon a predetermined value.
 14. The device according to claim 12, whereingenerating the consecutive write requests based on the target data, thezone padding data, and the second padding data includes: determiningmultiple data portions from the target data, the zone padding data, andthe second padding data according to a storage granularity associatedwith the storage area, wherein the size of each data portion correspondsto the storage granularity; and generating the consecutive writerequests based on the multiple data portions.
 15. The device accordingto claim 9, wherein the actions further include: reconstructing, inresponse to a request to reconstruct backup metadata for the storagearea, the backup metadata based on the zone length of the unavailablestorage zone, wherein the backup metadata indicates a distribution ofthe multiple storage zones.
 16. The device according to claim 9, whereinthe unavailable storage zone is marked as unavailable in response tobeing recycled.
 17. A computer program product having a non-transitorycomputer readable medium which stores a set of instructions to performdata writing; the set of instructions, when carried out by computerizedcircuitry, causing the computerized circuitry to perform a method of:determining an unavailable storage zone in multiple storage zones of astorage area, wherein each storage zone is used to store a zip headerand compressed data corresponding to the zip header; acquiring areference zip header for the unavailable storage zone, wherein thereference zip header includes metadata indicating a zone length of theunavailable storage zone; and generating consecutive write requests forthe storage area based at least on target data to be written to thestorage area and the reference zip header, so as to write the targetdata to available storage zones in the multiple storage zones.